#define  _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<time.h>
int jc1(int n)
{
	int i = 1,j=1;
	int sum = 0;
	for (i = 1; i <= n; i++)
	{
		int h = 1;
		for (j = 1; j <= i; j++)
		{
			h *= j;
		}
		sum += h;
	}

	return sum;
}
int main()
{
	clock_t t, w;
	int n;
	scanf("%d", &n);
	t = clock();
	int sum=jc1(n);
	w = clock();
	double s;
	s = (double)(w-t) / CLOCKS_PER_SEC;
	printf("%d\n", sum);
	printf("%.2lf\n", s);
	return 0;
}


                                                                                          